#include <OgreException.h>
#include <Ogre.h>
#include <OgreConfigFile.h>
#include <OgreCamera.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreEntity.h>
#include <OgreWindowEventUtilities.h>
#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>

class First : Ogre::WindowEventListener, public Ogre::FrameListener, public OIS::MouseListener, public OIS::KeyListener
{
private:
    // Ogre::FrameListener
    virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);
    virtual void windowClosed(Ogre::RenderWindow* rw);
    virtual void windowResized(Ogre::RenderWindow* rw);
    virtual void createScene(void);
    virtual void createCamera(void);
    virtual bool parseConfig(void);
    virtual void initializeVar(void);
    virtual void createFrameListener(void);
    virtual bool nextLocation(void);
    Ogre::Real mDistance;
    Ogre::Vector3 mDirection;
    Ogre::Vector3 mDestination;
    Ogre::Root* mRoot;
    Ogre::String mPluginsCfg;
    Ogre::String mResourcesCfg;
    Ogre::RenderWindow* mWindow;
    Ogre::SceneManager* mSceneMgr;
    Ogre::Overlay* mDebugOverlay;
    Ogre::OverlayManager* OverlayManager;
    Ogre::Camera* mCamera;
    Ogre::Entity* mScar;
    Ogre::Entity* mEntities[20][20];
    Ogre::SceneNode* mEntitiesNode[20][20];
    Ogre::SceneNode* mScarNode;
    OIS::InputManager* mInputManager;
    std::deque<Ogre::Vector3> mWalkList;
    Ogre::AnimationState *mAnimationState;
    Ogre::AnimationState *mEntitiesAS[20][20];
    Ogre::StringVector texte;
    OIS::Mouse* mMouse;
    OIS::Keyboard* mKeyboard;
    virtual bool keyPressed( const OIS::KeyEvent &arg );
    virtual bool keyReleased( const OIS::KeyEvent &arg );
    virtual bool mouseMoved( const OIS::MouseEvent &arg );
    virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
    virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
    Ogre::Vector3 mDirection_cam;
    Ogre::Vector3 mDirection_sca;
    Ogre::Vector3 mDirection_lan;
    int mMove;
    Ogre::Real mRotate;
    bool mShutdown;
public:
    First(void);
    virtual ~First(void);
    bool go(void);
    bool continuer;
};
